package com.cx.mall.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/param")
public class ParamController {
    @GetMapping("/get")
    public String getParam(
            @RequestParam(name="name",required = false,defaultValue = "admin") String
                    name,
            @RequestParam(name="age",required = true) Integer age,
            String sex){
        return "{name:" + name +",age:" + age +",sex:" + sex + "}";
    }
}
